require "watir-webdriver"


module ZDDI
	
	module Login
		class Login	
			def login(site, username, password)
				ZDDI.browser.goto(site)
				ZDDI.browser.text_field(:name, "login").set(username)
				ZDDI.browser.text_field(:name, "passwd").set(password)
				ZDDI.browser.button(:type, "submit").click
				sleep 2
				#ZDDI.browser.link(:href, "/system/services").click
				#if ZDDI.browser.url.include?"system/services"
				#	puts "login succeed"
				#else
				#	puts "login failed"
				#end
			end	
		end	
	end
	
end	
